package com.masterclient.app.businessmodule.settingmodule.auth.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

import com.masterclient.app.R;


public class CashSubmitIDsDialog extends Dialog{


    public CashSubmitIDsDialog(@NonNull Context context) {
        super(context,R.style.MyDialog);
    }

    private TextView tv_cancel,tv_confirm;
    View line;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_cash_submit_ids);
        tv_cancel = (TextView) findViewById(R.id.tv_cancel);
        tv_confirm = (TextView) findViewById(R.id.tv_confirm);
        line = findViewById(R.id.line);

        tv_cancel.setOnClickListener(v->{
            if(onChooseListerner!=null){
                onChooseListerner.cancel();
            }
        });
        tv_confirm.setOnClickListener(v->{
            if(onChooseListerner!=null){
                onChooseListerner.confirm();
            }
        });

    }

    @Override
    protected void onStart() {
        super.onStart();
        Window window = getWindow();
        WindowManager.LayoutParams windowparams = window.getAttributes();
        window.setGravity(Gravity.CENTER);
        window.setBackgroundDrawableResource(android.R.color.transparent);
        window.setAttributes(windowparams);
    }

    public void setOnChooseListerner(OnChooseListerner onChooseListerner) {
        this.onChooseListerner = onChooseListerner;
    }

    private OnChooseListerner onChooseListerner;

    public interface OnChooseListerner{
        public void cancel();
        public void confirm();
    }
}
